#ifndef FRMMAIN_H
#define FRMMAIN_H

#include <QObject>
#include "mytcpserver.h"
#include "databaseclass.h"
namespace Ui {
class frmMain;
}

class frmMain : public QObject
{
    Q_OBJECT
    
public:
    explicit frmMain(QObject *parent = 0);
    ~frmMain();
    
private slots:

    void ClientReadData(int clientID,QString IP,int Port,QByteArray data);
    void ClientConnect(int clientID,QString IP,int Port);
    void ClientDisConnect(int clientID,QString IP,int Port);

private:
    myTcpServer *server;
    databaseClass * dataLink;
    QTcpSocket *client_socket;
    QTcpServer *local_socket;
    QTimer *timer;
    QDateTime startTime;
private slots:
    void Init();
    void initTimer();
    void initServer();
    void local_socket_newConnect();
    void local_socket_recProcess();
    void local_socket_disConnect();
    void traffer_netdata();
public slots:
    void openDoorReceive(QString);
};

#endif // FRMMAIN_H
